Docker: Respect SE_SCREEN_{WIDTH,HEIGHT} variables in ffmpeg recording #2629
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Description
Currently, these variables are always overridden in the call the wait_for_display(). Before the upgrade to ffmpeg-7.0.2 (PR #2374), the SE_SCREEN_WIDTH and SE_SCREEN_HEIGHT variables were respected in the case where no video uploading was done because wait_for_display() was never called. After the upgrade to 7.0.2, the function is always called and overrides the VIDEO_SIZE variable.
Now, if both screen width and height are specified, VIDEO_SIZE is not overridden and users can control the recording size again.
Motivation and Context
In versions earlier than
selenium/video:ffmpeg-7.0.2
, the dimensions for recordings are SE_SCREEN_WIDTH x SE_SCREEN_HEIGHT of theselenium/video
container. In later versions, the dimensions are SE_SCREEN_WIDTH x SE_SCREEN_HEIGHT of the Selenium node container. This breaks some workflows because of the unexpected recording size.To reproduce the issue, this
docker-compose.yml
file can be started and then stopped:When using
selenium/video:ffmpeg-7.0.2-20240829
or newer images, the recording size is 1920x150 px but withselenium/video:ffmpeg-7.0.1-20240820
, the recording is 306x46 px. With these changes the recording is once again 306x46 px.If either of SE_SCREEN_WIDTH or SE_SCREEN_HEIGHT is missing then the behavior falls back to using the node's resolution.
Types of changes
Checklist
PR Type
Bug fix
Description
Ensure
SE_SCREEN_WIDTH
andSE_SCREEN_HEIGHT
variables control recording size.Prevent overriding
VIDEO_SIZE
when screen dimensions are specified.Remove default screen width and height from Dockerfile environment variables.
Changes walkthrough 📝
video.sh
Conditional handling of `VIDEO_SIZE` in `video.sh`
Video/video.sh
SE_SCREEN_WIDTH
andSE_SCREEN_HEIGHT
.VIDEO_SIZE
if screen dimensions are set.Dockerfile
Removed default screen dimensions from Dockerfile
Video/Dockerfile
SE_SCREEN_WIDTH
andSE_SCREEN_HEIGHT
.